#ifndef LRCPAGE_H
#define LRCPAGE_H

#include <QWidget>
#include <QPropertyAnimation>
#include <QJsonArray>

namespace Ui {
class LrcPage;
}

class LrcLineInfo{
public:
    qint64 time;
    QString lryrics;

    LrcLineInfo(qint64 qtime, QString qlryrics)
    {
        time = qtime;
        qlryrics = lryrics;
    }

    LrcLineInfo()
    {

    }
};

class LrcPage : public QWidget
{
    Q_OBJECT

public:
    explicit LrcPage(QWidget *parent = nullptr);

    void parseLrcFile(QString& filePath);

    QJsonArray getJsonArray();

    void showLrcWordLine(int);

    int getLrcLineIndex(int);

    QString getLrcLineWord(int);

    void setMusicInfo(QString&, QString&);

    ~LrcPage();

private:
    Ui::LrcPage *ui;

    QPropertyAnimation* pullDownAnimation;

    QVector<LrcLineInfo> lrcLines;
};

#endif // LRCPAGE_H
